package com.me.components {
	import com.me.FileLoader;
	import com.me.components.map.MapScene;

	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.DisplayObject;
	import flash.events.MouseEvent;
	import flash.filesystem.File;
	import flash.geom.Point;
	import flash.geom.Rectangle;

	import mx.controls.Alert;

	import spark.core.SpriteVisualElement;

	/**
	 *
	 * @author yw
	 *
	 * @Date 2011-9-16 下午03:48:48
	 */
	public class LocalImage extends MapResource {

		public function LocalImage(file:File) {
			super();
			_fileName = file.name;
			FileLoader.getInstance().loadFile(file, fileLoaded);
		}

		private function fileLoaded(data:Bitmap):void {
			width = data.width;
			height = data.height;
			var bd:BitmapData = new BitmapData(data.width, data.height);
			bd.copyPixels(data.bitmapData, data.bitmapData.rect, new Point(0, 0));
			addChild(new Bitmap(bd));
		}
	}
}